//
//  receiveChatSend.m
//  tcpoctest
//
//  Created by apple on 13-7-22.
//  Copyright (c) 2013年 gump. All rights reserved.
//

#import "receiveChatSend.h"
#import "sendMessageReceipt.h"
#import "chatDataSource.h"
#import "ChatContentInfo.h"
#import "chatuserdb.h"

@implementation receiveChatSend

-(void)processreceive
{
    //接收 16char(1),229char(1),已阅读消息ID长度char(1),
    //已经阅读消息IDchar(x),本消息ID长度char(1),本消息IDchar(x),
    
    NSString *strread = [logicsb ReadUnencodeString];
    
    ChatContentInfo *ccinfo = [[DataControl shareControl].chatDS getChatInfoByID:strread];
    if (ccinfo != nil) {
        ccinfo.ichatReadState = CRS_READ;
        
        [[DataBaseCtrol shareControl].chatuserdatabase UpdateChatState:ccinfo];
        [[DataControl shareControl].UICommendDS addUICommand:UC_CHAT_REFRESH];
    }
    
    NSString *msgid = [logicsb ReadUnencodeString];
    
    [[netManager sharedNetManager].sendMsgReceipt SendMegReceipt:msgid];
    
    
    [self ShowLog];
}

@end
